package com.leyou.test1.constants;

import lombok.Getter;

@Getter
public enum SystemCodeEnum {
    TIP("1","TIP"),
    EPS("2","EPS"),
    BBC("3","BBC"),
    SAP("4","SAP");
    private String code;
    private String name;

    SystemCodeEnum(String code,String name){
        this.code=code;
        this.name=name;
    }

    public static SystemCodeEnum getSysCode(String code) {
        for (SystemCodeEnum systemCodeEnum : SystemCodeEnum.values()) {
            if (systemCodeEnum.getCode().equals(code)){
                return systemCodeEnum;
            }
        }
        return null;
    }
    public static SystemCodeEnum getSysCode2(String name) {

        for (SystemCodeEnum systemCodeEnum : SystemCodeEnum.values()) {
            if (systemCodeEnum.getName().equals(name)){
                return systemCodeEnum;
            }
        }
        return null;
    }
}
